#ifndef _OBSERVER_H_
#define _OBSERVER_H_

#include <list>


class CObserver
{
public:
	virtual void update(void * newData, int length) = 0;
	void registerEvent(void* notifier);
};


class CDisplay : public CObserver
{
private:
	char * m_strToDisplay;
public:
	virtual void update(void * newData,int length);
};

class CAnalyze : public CObserver
{
private:
	char * m_result;
public:
	virtual void update(void * newData, int length);
};

class CNotifier
{
private:
	std::list<CObserver*> m_listPtrObservers;

public:
	void addToList(CObserver* ptrObserver);
	void removeObserver(CObserver* ptrObserver);

	void notify(void * newData, int length);

	CNotifier();
	~CNotifier();
};

#endif